package com.codejoys.monitor.event;

import com.codejoys.monitor.dto.DeviceDto;
import org.springframework.context.ApplicationEvent;

public class AlarmEvent extends ApplicationEvent {
    private DeviceDto device;

    // source: 事件发布者，从哪个对象里面发布消息，就传入该对象
    // 设备：发生故障的设备
    public AlarmEvent(Object source, DeviceDto device) {
        super(source);

        this.device = device;
    }

    public DeviceDto getDevice() {
        return this.device;
    }
}
